<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<title>01求2的n次幂</title>
	</head>
	<body>
		
		<script type="text/javascript">
			//1. 获取输入的数据
			let n = + prompt('请输入自然数',0);
		/* 	//2. 定义一个变量，存储结果
			let result = 1;
			//3. 循环累乘
			while(n > 0){
				result *= 2;
				n--;
			}
			console.log(result); */
			
			console.log(2**n);
			
		</script>
	</body>
</html>
